-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Typing][B-49] Add type annotations for python/paddle/base/layer_helper.py
#66639
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像又是没有公开 API 的文件
python/paddle/base/layer_helper.py
Outdated
inputs = self.multiple_input(input_param_name) | ||
if len(inputs) != 1: | ||
raise f"{self.layer_type} layer only takes one input" | ||
return inputs[0] | ||
|
||
@property | ||
def param_attr(self): | ||
def param_attr(self) -> ParamAttrLike | list[ParamAttrLike]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用的 ParamAttrLike
是不是都应该是 ParamAttr
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,已修改~
python/paddle/base/layer_helper.py
Outdated
inputs = self.multiple_input(input_param_name) | ||
if len(inputs) != 1: | ||
raise f"{self.layer_type} layer only takes one input" | ||
return inputs[0] | ||
|
||
@property | ||
def param_attr(self): | ||
def param_attr(self) -> ParamAttr | list[ParamAttr]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是按理说只会有一个?应该不会出现 list?bias 同
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Category
User Experience
PR Types
Improvements
Description
类型标注:
-
python/paddle/base/layer_helper.py
Related links
@SigureMo @megemini